package com.forbiddendesert.logic;

import java.util.Vector;

import com.forbiddendesert.actions.Action;

public class Storm 
{
	// The current storm level
	// How many actions the storm takes.
	int mStormLevel;
	
	// How severe the storm is.
	int mStormSeverity;
	
	Vector<Action> mActions;
	
	boolean mDeadly;
	
	public Storm()
	{
		mStormSeverity = 0;
		calculateStormLevel();
		
		mActions = new Vector<Action>();
		mDeadly = false;
	}
	
	// This function is calibrated for three player normal difficulty.
	private void calculateStormLevel()
	{
		if(mStormSeverity <= 1)
		{
			mStormLevel = 3;
			return;
		}
		
		if(mStormSeverity <= 5)
		{
			mStormLevel = 4;
			return;
		}
		
		if(mStormSeverity <= 8)
		{
			mStormLevel = 5;
			return;
		}
		
		if(mStormSeverity <= 10)
		{
			mStormLevel = 6;
			return;
		}
		
		mStormLevel = 7;
		mDeadly = true;
	}
	
	public int getStormLevel()
	{
		return mStormLevel;
	}
	
	public int getStormSeverity()
	{
		return mStormSeverity;
	}
	
	public void setStormSeverity(int severity)
	{
		mStormSeverity = severity;
		calculateStormLevel();
	}
	
	public void incrementStormSeverity()
	{
		mStormSeverity++;
		calculateStormLevel();
	}
}
